/*
 * *
 *  * Copyright (c) iwindplus Technologies Co., Ltd.2024-2030, All rights reserved.
 *
 *
 */

package com.iwindplus.boot.operate;

import com.iwindplus.boot.operate.aspect.OperateValidAspect;
import com.iwindplus.boot.operate.domain.property.OperateValidProperty;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * GA配置.
 *
 * @author zengdegui
 * @since 2023/08/31 20:32
 */
@Slf4j
@Configuration
@EnableConfigurationProperties({OperateValidProperty.class})
@ConditionalOnProperty(prefix = "operate.valid", name = "enabled", havingValue = "true", matchIfMissing = true)
public class OperateValidConfiguration {

    /**
     * 创建 OperateValidAspect.
     *
     * @return OperateValidAspect
     */
    @Bean
    public OperateValidAspect operateValidAspect() {
        OperateValidAspect operateValidAspect = new OperateValidAspect();
        log.info("OperateValidAspect={}", operateValidAspect);
        return operateValidAspect;
    }

}
